-- captain_diary
-- created by huanghr
-- 舰长的日记

return {
    -- 获取道具描述
    getDesc = function()
        -- 获取最近一次修理飞艇的时间
        local lastRepaireTime = NewAirShipM.getLastRepairTime();
        local curTime = TimeM.getServerTime();
        local diffTime = curTime - lastRepaireTime;
        local day  = math.modf(diffTime / 86400);
        local hour = math.modf((diffTime % 86400)/3600);
        local timeStr = "";

        if day > 0 then
            timeStr = timeStr .. string.format(getLocStr("reset_days"), day);
        end

        if hour > 0 then
            timeStr = timeStr .. string.format(getLocStr("reset_hour"), hour);
        else
            timeStr = timeStr .. string.format(getLocStr("reset_hour"), 1);
        end

        local desc = string.format(getLocStr("captain_diary_desc2"), timeStr);

        return desc;
    end,
};
